<h3 >Lista stolova</h3>
<a ng-controller="StoDetaljiListCtrl" class="btn btn-success" ng-click="izmena('novi');" href="#/stoDetalji">
    <i class="icon-calendar icon-white"></i>&nbsp;Kreiraj novi sto
</a>
<script>
    sessionStorage.removeItem("index");
</script>
<table ng-controller="StoListCtrl" id="searchObjResults" class='table table-striped'>
    <thead>
    <tr>
        <th>Sto</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
    </tr>
    </thead>
    <tbody>
    <tr>
		<td>
			<label ng-click="orderByField = 'brojStola'; reverseSort = !reverseSort">
				<b>Broj stola</b>
				<span ng-show="orderByField == 'brojStola'">
					<span ng-show="!reverseSort" class="glyphicon glyphicon-chevron-down"></span>
					<span ng-show="reverseSort" class="glyphicon glyphicon-chevron-down"></span>
				</span>
			</label>
		</td>
		<td></td><td></td>
	</tr>
    <tr ng-repeat='sto in stolovi | filter:search:strict | startFrom:currentPage*pageSize | limitTo:pageSize' onload="JavaScript:timedRefresh(500);">
        <td>{{sto.brojStola}}</td>
        <td><a ng-controller="StoDetaljiListCtrl" class='btn btn-warning' ng-click="izmena(sto);" href="#/stoDetalji">Izmeni</a></td>
        <td><button ng-controller="StoListCtrl" class="btn btn-danger" ng-click="delete(sto)">
                <span class="glyphicon glyphicon-trash"></span> &nbsp;Obriši
            </button>
        </td>
    </tr>
    <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
    <tr>
        <td >
            <button class="btn btn-success" ng-disabled="currentPage == 0" ng-click="currentPage=currentPage-1">
                <span class="glyphicon glyphicon-chevron-left"></span>Previous
            </button>
        </td>
        <td><h4>{{currentPage+1}}/{{2}}</h4></td>
        <td>
            <button class="btn btn-success" ng-disabled="currentPage >= data.length/pageSize - 1" ng-click="currentPage=currentPage+1">
                <span class="glyphicon glyphicon-chevron-right"></span>Next
            </button>
        </td>
        <td></td><td></td><td></td><td></td>
    </tr>
    </tbody>
</table>
<div class="modal fade"  tabindex="-1" role="dialog" ng-include="'view/sto-detalji.html'" id="editModal" aria-hidden="true"></div>
</div>